//
//  SliderViewController.m
//  SPDBank
//
//  Created by hanxifeng on 14-12-25.
//  Copyright (c) 2014年 王 焕. All rights reserved.
//

#import "SliderViewController.h"
#import "MenuViewController.h"
#import "SuggestionViewController.h"
#import "TellerInfoViewController.h"
@interface SliderViewController ()
@property (nonatomic, strong) NSMutableArray* viewControllerArray;
@end

@implementation SliderViewController

- (void)viewDidLoad {
    self.dataSource = self;
    self.title = @"浦发银行";
    //导航栏不透明 否则视图上窜
    self.navigationController.navigationBar.translucent = NO;
    NSUInteger numberOfPages = 3;
    self.viewControllerArray = [[NSMutableArray alloc] initWithCapacity:numberOfPages];
    TellerInfoViewController *teller = [[TellerInfoViewController alloc]init];
//    UINavigationController *navTeller = [[UINavigationController alloc]initWithRootViewController:teller];
    teller.dataDic = _dataDic;
    SuggestionViewController *suggestion = [[SuggestionViewController alloc]init];
//    UINavigationController *navSuggestion = [[UINavigationController alloc]initWithRootViewController:suggestion];
    MenuViewController *menu= [[MenuViewController alloc]init];
//    UINavigationController *navMenu = [[UINavigationController alloc]initWithRootViewController:menu];
    for (NSUInteger k = 0; k < numberOfPages; ++k)
    {
        [self.viewControllerArray addObject:[NSNull null]];
    }
    
    [self.viewControllerArray replaceObjectAtIndex: 0 withObject: teller];
    [self.viewControllerArray replaceObjectAtIndex: 1 withObject: suggestion];
    [self.viewControllerArray replaceObjectAtIndex: 2 withObject: menu];
    [super viewDidLoad];
}
#pragma mark - DDScrollViewDataSource

- (NSUInteger)numberOfViewControllerInDDScrollView:(DDScrollViewController *)DDScrollView
{
    return [self.viewControllerArray count];
}

- (UIViewController*)ddScrollView:(DDScrollViewController *)ddScrollView contentViewControllerAtIndex:(NSUInteger)index
{
    return [self.viewControllerArray objectAtIndex:index];
}
@end
